<?php

/*
 * @author Ebrain Cedeno <ebraincedeno@gmail.com>
 */

class TSession extends TWidget{
    
    public static function add($name,$value){
        $_SESSION[$name]=$value;
    }
    
    public static function remove($name){
        if (isset($_SESSION[$name])){
            unset($_SESSION[$name]);
        }
    }
    
    public static function getSession($name){
        if (isset($_SESSION[$name])){
            return $_SESSION[$name];
        }
    }
    
    public static function SessionActive(){
        self::add("active", true);
    }
    
    public static function getStatusSession(){
        if (isset($_SESSION['active']) AND $_SESSION['active'] == true){
            return true;
        }
        else{
            return false;
        }
    }
    
    public static function Sessiondestroy(){
        session_destroy();
    }
}

?>
